package abstractFactory.factory.Impl;

import abstractFactory.factory.AbsFactory;
import abstractFactory.pizza.Impl.BJCheesePizza;
import abstractFactory.pizza.Impl.BJPepperPizza;
import abstractFactory.pizza.Pizza;

/**
 * @author : DuJiabao
 * @Date : 2021/3/1 21:34
 * @Project : design-pattern
 * @File : null.java
 * @Desc :
 */
public class BJFactory implements AbsFactory {

  @Override
  public Pizza createPizza(String name) {
    return switch (name) {
      case "Cheese" -> new BJCheesePizza();
      case "Pepper" -> new BJPepperPizza();
      default -> null;
    };
  }
}
